<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page
	import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<%@ page import="org.springframework.context.ApplicationContext"%>
<%@ page import="com.shiplanet.service.CategoryService"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%
	ServletContext sc = this.getServletConfig().getServletContext();
	ApplicationContext ac2 = WebApplicationContextUtils
	.getWebApplicationContext(sc);
	CategoryService categoryService = (CategoryService) ac2
	.getBean("categoryService");
	request.setAttribute("categoryMap",
	categoryService.getCategoryNameMap(true, false));
%>

<section class="background-page">
	<div class="row padding-top">

		<tiles:insertAttribute name="adminmenu" />

		<article class="column custom-main-column">

			<div id="top" class="row collapse">
				<div class="column large-12">

					<s:form action="savePost" namespace="/admin" enctype="multipart/form-data" method="post" cssClass="custom ng-pristine ng-valid" theme="simple">

						<div class="row">
							<div
								class="box-shadow background-white more-margin-bottom clearfix card content-padding">
								<div
									class="large-12 clearfix blue-topper heading-padding card-header">
									<h3 class="inverse no-margin-top no-margin-bottom">
										<span class="semi-bold"><em>Equipment Category</em></span>
									</h3>
								</div>
								<div class="column large-4 small-margin-top">
									<p class="gray italic">You must classify the equipment you
										are selling. Select one of the following categories of
										equipment:</p>
								</div>

								<div class="column large-8 small-margin-top small-margin-bottom">
									<div class="form-row rp_listing_details_category">
										<label class="required">Please select category of
											equipment</label>
										<div class="row category-hybrid">
											<div class="column large-12 category-hybrid-root">
												<div class="form-widget select-list ">
													<s:select id="rp_listing_details_category_rootCategory"
														name="categoryId" list="#request.categoryMap" headerKey=""
														headerValue="-- Select Equipment Category --"
														theme="simple" cssClass="hidden-field" />

													<div class="custom dropdown" data-id="1415153624390-0SrB2">
														<a href="http://www.shiplanet.com/#" class="current">--
															Select Equipment Category -- </a><a
															href="http://www.shiplanet.com/#" class="selector"></a>
														<ul>
															<li class="selected">-- Select Equipment Category --</li>
															<s:iterator value="categoryMap" var="map">
																<li class="">${map.value}</li>
															</s:iterator>
														</ul>
													</div>

												</div>
												<div rel="rp_listing_details_category_rootCategory"
													class="helper required "></div>
											</div>

										</div>
										<div rel="rp_listing_details_category"
											class="helper required "></div>
									</div>
								</div>
							</div>
						</div>

						<div class="row">
							<div
								class="box-shadow background-white more-margin-bottom clearfix card content-padding">
								<div
									class="large-12 clearfix blue-topper heading-padding card-header">
									<h3 class="inverse no-margin-top no-margin-bottom">
										<span class="semi-bold"><em>Post Description</em></span>
									</h3>
								</div>
								<div class="column large-4 small-margin-top">
									<p class="gray italic">Give your equipment post an
										appropriate title and description to display on our site.</p>
								</div>

								<div class="column large-8 small-margin-top small-margin-bottom">
									<div class="form-row rp_listing_details_name">
										<label for="rp_listing_details_name" class="required">Equipment Name</label>
										<div id="rp_listing_details_name" class="form-widget">
											<input type="text" id="rp_listing_details_name"
												name="post.equipmentName" required="required">
										</div>
										<div rel="rp_listing_details_name" class="helper required "></div>
									</div>
									<div class="form-row rp_listing_details_abstract">
										<label for="rp_listing_details_abstract" class="required">Title</label>
										<div id="rp_listing_details_abstract" class="form-widget">
											<textarea id="rp_listing_details_abstract"
												name="post.title" required="required"></textarea>
										</div>
										<div rel="rp_listing_details_abstract"
											class="helper required valid"></div>
									</div>
									<div class="form-row rp_listing_details_description">
										<label for="rp_listing_details_description" class="required">Description</label>
										<div id="rp_listing_details_description" rows="10"
											class="form-widget">
											<textarea id="rp_listing_details_description"
												name="post.equipmentDescription" required="required"
												rows="10"></textarea>
										</div>
										<div rel="rp_listing_details_description"
											class="helper required valid"></div>
									</div>
								</div>
							</div>
						</div>

						<div class="row collapse">
							<div
								class="box-shadow background-white more-margin-bottom clearfix card content-padding">
								<div
									class="large-12 clearfix blue-topper heading-padding card-header">
									<h3 class="inverse no-margin-top no-margin-bottom">
										<span class="semi-bold"><em>Optional Details</em></span>
									</h3>
								</div>
								<div class="column large-4 small-margin-top">
									<p class="gray italic">To help buyers narrow down their
										equipment search, fill out the following additional details
										about the equipment.</p>
								</div>

								<div class="column large-8 small-margin-top small-margin-bottom">
									<div class="form-row rp_listing_options_equipmentLocation">
										<label for="rp_listing_options_equipmentLocation">Location</label>
										<div id="rp_listing_options_equipmentLocation" class="form-widget">
											<input type="text" id="rp_listing_options_equipmentLocation"
												name="post.equipmentLocation">
										</div>
										<div rel="rp_listing_options_askingPrice" class="helper  "></div>
									</div>
									<div class="form-row rp_listing_options_equipmentManufacturer">
										<label for="rp_listing_options_equipmentManufacturer">Manufacturer</label>
										<div id="rp_listing_options_equipmentManufacturer" class="form-widget">
											<input type="text" id="rp_listing_options_equipmentManufacturer"
												name="post.equipmentManufacturer" maxlength="100">
										</div>
										<div rel="rp_listing_options_make" class="helper  "></div>
									</div>
									<div class="form-row rp_listing_options_model">
										<label for="rp_listing_options_model">Item Number</label>
										<div id="rp_listing_options_model" class="form-widget">
											<input type="text" id="rp_listing_options_model"
												name="post.equipmentItemNumber" maxlength="100">
										</div>
										<div rel="rp_listing_options_model" class="helper  "></div>
									</div>
									<div class="form-row rp_listing_options_year">
										<label for="rp_listing_options_year">Year</label>
										<div id="rp_listing_options_year" class="form-widget">
											<input type="text" id="rp_listing_options_year"
												name="post.equipmentYear" >
										</div>
										<div rel="rp_listing_options_year" class="helper  "></div>
									</div>
									<div class="form-row rp_listing_details_feature">
										<label for="rp_listing_details_feature">Is Feature</label>
										<div id="rp_listing_details_feature" class="form-widget">
											<input type="checkbox" name="post.featured" value="true">
										</div>
										<div rel="rp_listing_details_feature"
											class="helper required valid"></div>
									</div>										
								</div>
							</div>
						</div>

						<div class="row collapse">
							<div
								class="box-shadow background-white more-margin-bottom clearfix card content-padding">
								<div
									class="large-12 clearfix blue-topper heading-padding card-header">
									<h3 class="inverse no-margin-top no-margin-bottom">
										<span class="semi-bold"><em>Your Notes</em></span>
									</h3>
								</div>
								<div class="column large-4 small-margin-top">
									<p class="gray italic">Only visible to you.</p>
								</div>

								<div class="column large-8 small-margin-top small-margin-bottom">
									<div class="form-row rp_listing_options_notes">
										<label for="rp_listing_options_notes">Notes</label>
										<div id="rp_listing_options_notes" class="form-widget">
											<textarea id="rp_listing_options_notes"
												name="post.interMemo"></textarea>
										</div>
										<div rel="rp_listing_options_notes" class="helper  "></div>
									</div>
								</div>
							</div>
						</div>
						
						<div class="row collapse">
							<div
								class="box-shadow background-white more-margin-bottom clearfix card content-padding">
								<div
									class="large-12 clearfix blue-topper heading-padding card-header">
									<h3 class="inverse no-margin-top no-margin-bottom">
										<span class="semi-bold"><em>Post Photo</em></span>
									</h3>
								</div>
								<div class="column large-4 small-margin-top">
									<p class="gray italic">Give the four photos as the Post cover.</p>
								</div>

								<div class="column large-8 small-margin-top small-margin-bottom">
									<div class="form-row rp_listing_options_photos">
										<label for="rp_listing_options_photos">Photos</label>
										<div id="rp_listing_options_photos" class="form-widget">
											<input type="file" id="rp_listing_options_photos"
												name="photoFiles" multiple="multiple"/>
										</div>
										<div rel="rp_listing_options_photos" class="helper  "></div>
									</div>
								</div>
							</div>
						</div>
						
						<div class="row collapse">
							<button class="small right" id="payment-submit" type="submit">
								Save
							</button>
						</div>

					</s:form>

				</div>
			</div>

		</article>
	</div>
</section>